package com.hnas.eCard.service;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.hnas.api.dto.DTOResult;
import com.hnas.eCard.orm.AccECard;
import com.hnas.eCard.orm.CardTrail;
import com.hnas.eCard.service.dto.DTOSaleCardOrderDetail;

public interface CardTrailService {
	
	/**
	 * 根据账户id和卡状态(已赠送、已接收)查询电子卡列表
	 * @param accId
	 * @param phoneNo
	 * @param searchStatus
	 * @param pageNo
	 * @param pageSize
	 * @return JSONObject
	 */
	public JSONObject findECardsByStatus(String accId, String phoneNo, String searchStatus, Integer pageNo, Integer pageSize) throws Exception;
	
	/**
	 * 通过电子卡状态查询电子卡
	 * @param accId
	 * @param phoneNo
	 * @return
	 */
	List<CardTrail> findCardsByStatus(String accId ,String phoneNo,String status);
	
	CardTrail saveOrUpdate(CardTrail vo) throws Exception;

	public List<CardTrail> listByCardAndDate(String cardNo, String date);
	/**
	 * 根据卡号查询赠卡记录
	 * @Title: findByCards  
	 * @Description:  
	 * @param changeString
	 * @return
	 * @throws
	 */
	public List<CardTrail> listByCards(String sendAccId,String sendPhoneNo,String receivePhoneNo,String changeString);
	/**
	 * 批量赠送
	 * @Title: batchSave  
	 * @Description:  
	 * @param accId
	 * @param orderDetailDto
	 * @throws
	 */
	public int batchSave(String accId, DTOSaleCardOrderDetail orderDetailDto);
	/**
	 * 分享电子卡
	 * @Title: createShareCode  
	 * @Description:  
	 * @param cardNo
	 * @param sendMsg
	 * @throws
	 */
	public boolean shareECard(AccECard accECard,CardTrail cardTrail) throws Exception;
	/**
	 * 根据分享码查询卡信息
	 * @Title: findCardInfo  
	 * @Description:  
	 * @param shareCode
	 * @throws
	 */
	public DTOResult findCardInfo(String shareCode,DTOResult dtoResult) throws Exception;

	public CardTrail findByShareCode(String shareCode);
	
}
